<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class name="cn.ffcs.organ.model.Organization" table="T_ORGAN_ORGANIZATION">
        <id name="id" type="java.lang.Integer">
            <column name="id" />
            <generator  class="cn.ffcs.util.hibernate.generator.MyGenerator">
				<param name="table">T_COMM_SEQUENCE</param>
				<param name="column">NEXT_VAL</param>
				<param name="sequence_column">NAME</param>
				<param name="sequence_name">SEQ_ORGAN_ORGANIZATION</param>
			</generator>
        </id>
        <property name="name" type="java.lang.String">
            <column name="name" length="256" not-null="true" />
        </property>
        <property name="orgType" type="java.lang.String">
            <column name="org_type" length="32" not-null="true" />
        </property>
        <property name="orgLevel" type="java.lang.Integer">
            <column name="org_level" length="2" not-null="true" />
        </property>
        <property name="orgIndex" type="java.lang.String">
            <column name="org_index" length="32" not-null="true" />
        </property>
        <property name="codeID" type="java.lang.String">
            <column name="code_ID" length="32" not-null="true" />
        </property>
        <property name="superior" type="java.lang.String">
            <column name="superior" length="64" not-null="true" />
        </property>
        <property name="description" type="java.lang.String">
            <column name="description" length="32" not-null="true" />
        </property>
        <property name="author" type="java.lang.String">
            <column name="author" length="64" not-null="true" />
        </property>
        <property name="creator" type="java.lang.String">
            <column name="creator" length="64" not-null="true" />
        </property>
        <property name="begin" type="timestamp">
            <column name="begin" length="64"/>
        </property>
        <property name="end" type="timestamp">
            <column name="end" length="64"/>
        </property>
        <property name="fullName" type="java.lang.String">
            <column name="full_name_" length="1000" not-null="true" />
        </property>
        <property name="shortName" type="java.lang.String">
            <column name="short_name" length="256"/>
        </property>
        <property name="parentName" type="java.lang.String"  formula="(select name from T_ORGAN_ORGANIZATION  s where s.ID=ID )"></property>
        <property name="childCount" type="java.lang.Integer" formula="(select count(*) from T_ORGAN_ORGANIZATION  s where s.superior=ID )" ></property>
    </class>
</hibernate-mapping>